<template>
  <div>
    <!-- 三级联动组件（三级联动组件已经全局注册，不需要注册） -->
    <TypeNav></TypeNav>
    <!--  -->
    <ListContainer />
    <TodayRecommend />
    <Rank />
    <Likes/>
    <Floor v-for="(floor) in floorList" :key="floor.id" :list="floor"/>
    <Brand/>
  </div>
</template>

<script>
// 引入其他组件
import ListContainer from "@/views/Home/LIstContainer";
import TodayRecommend from "@/views/Home/Today-Recommend";
import Rank from "@/views/Home/Rank";
import Likes from '@/views/Home/Likes';
import Floor from '@/views/Home/Floor';
import Brand from '@/views/Home/Brand';
import { mapState } from "vuex";
export default {
  name: "Home",
  components: {
    ListContainer,
    TodayRecommend,
    Rank,
    Likes,
    Floor,
    Brand,
  },
  mounted(){
    //派发action，获取floor组件数据
    this.$store.dispatch("getFloorList");
  },
  computed: {
    ...mapState({
      floorList: (state) => {
        return state.home.floorList;
      },
    }),
  },
 
};
</script>

<style>
</style>